package com.winding.plugin.swagger;

import com.thoughtworks.qdox.model.JavaClass;
import com.winding.plugin.swagger.param.AbstractParamParse;
import com.winding.plugin.swagger.param.BodyParamParse;
import com.winding.plugin.swagger.param.PathParamParse;
import com.winding.plugin.swagger.param.QueryParamParse;
import io.swagger.converter.ModelConverters;
import io.swagger.models.Swagger;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * <p>TODO
 *
 * @author wind
 * @version 1.0
 * @since 2018/12/5
 */
@Slf4j
public abstract class AbstractSwaggerDocReader {
    protected Swagger swagger;
    protected static ModelConverters modelConverters = new ModelConverters();
    protected AbstractParamParse bodyParse = new BodyParamParse(modelConverters);
    protected AbstractParamParse pathParse = new PathParamParse(modelConverters);
    protected AbstractParamParse queryParse = new QueryParamParse(modelConverters);

    /**
     * 读取
     *
     * @param classJavaClassMap JavaClass Map 集合
     * @return the Object of {@code Swagger}
     */
    public abstract Swagger read(Map<String, JavaClass> classJavaClassMap);

    public AbstractSwaggerDocReader(Swagger swagger) {
        this.swagger = swagger;
    }

}
